
import java.math.BigDecimal;




/**
 * @author navas
 *
 */
public class Num extends Expr {

	private BigDecimal value;
	private int priority;

	public Num(String value) {

		this.value=new BigDecimal(value);
	}


	public Num(BigDecimal num) {
		value = num;
		priority = 1;
	}


	/**
	 * metodo ridefinito che ritorna il valore 
	 * numerico dell'oggetto Num
	 */
	@Override
	public BigDecimal evaluate(Env env) {
		return value;
	}

	public static Num _ (String value){
		return new Num(value);
	}


	@Override
	public String toString() {
		return value+"";
	}

	@Override
	public boolean isUnExpr() {
		// TODO Auto-generated method stub
		return false;
	}


	@Override
	public boolean isAssignExpr() {
		// TODO Auto-generated method stub
		return false;
	}


	@Override
	public boolean isPlusBinExpr() {
		// TODO Auto-generated method stub
		return false;
	}


	@Override
	public boolean isMinusBinExpr() {
		// TODO Auto-generated method stub
		return false;
	}


	@Override
	public boolean isTimesBinExpr() {
		// TODO Auto-generated method stub
		return false;
	}


	@Override
	public boolean isDivideBinExpr() {
		// TODO Auto-generated method stub
		return false;
	}




	@Override
	public boolean isNum() {
		// TODO Auto-generated method stub
		return true;
	}


	@Override
	public boolean isId() {
		// TODO Auto-generated method stub
		return false;
	}


	@Override
	public boolean isSeqExpr() {
		// TODO Auto-generated method stub
		return false;
	}

}
